<!DOCTYPE html>
<html lang="Zh-cn">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>文章详情</title>
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
	<link rel="icon" href="favicon.ico" >
	<style type="text/css">
		.user{
			display: flex;
			width: 100%;
		}
	</style>
</head>
<body>

	<!-- daohangtiao -->
	<nav class="navbar navbar-default">
		<div class="container-fluid">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#a" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
				<a  class="navbar-brand" href="index.html">
				liuboy
				</a>
			</div>
			<a href="login.html" class="navbar-right navbar-link navbar-text loginUser">登陆/注册</a>
			<div id="a" class="collapse navbar-collapse">
			<ul class="nav navbar-nav">
			<li><a href="wenzhang.html">文章</a></li>
			<li><a href="fenxiang.html">分享</a></li>
			<li><a href="liuyan.html">留言</a></li>
			</ul>
			
		</div>

		</div>
	</nav>
</head>
<body>
	<h2></h2>
	<div id="content"></div>
</body>
<script
  src="https://code.jquery.com/jquery-3.5.1.js"
  integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc="
  crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script type="text/javascript">
 var id = window.location.search.substr(4)

 console.log(window.location.search.substr(4))
	$.post("wenzhangxiangqing.php",{id:id},function(wenzhangxiangqing){
		var wenzhangxiangqingData = JSON.parse(wenzhangxiangqing)
		// console.log(wenzhangxiangqingData)
		$("h2").html(wenzhangxiangqingData[0].title)
		$("#content").html(wenzhangxiangqingData[0].content)
	})   
	$.get("userid.php",function(id){
		var userData = JSON.parse(id);
		console.log(userData);
		$(".loginUser").replaceWith("<a href='putongyonghu.html' class='navbar-right navbar-link navbar-text loginUser'>欢迎您，"+userData[0].username+"</a><span class='glyphicon glyphicon-user navbar-right navbar-text' aria-hidden='true'></span>&nbsp<a href='zhuxiao.php' class='navbar-right navbar-link navbar-text'>注销</a>");
	
	});
</script>
</html>